<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
 <script type="text/javascript" src="./jquery.js"></script>
    <script type="text/javascript" src="./stickytooltip.js"></script>
    <link href="stickytooltip.css" rel="stylesheet" type="text/css">
<title>Công nghệ Web & Ứng dụng</title>
</head>
<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
require_once('mysql.php');
require_once ('function.php');
    
   $san_pham = Sanpham();
   //$sanpham_apple1 = Sanpham();
   ?>
   <h2>Danh Sách Tất Cả Sản Phẩm LG</h2>

<table border="1" >
   
     <?php
	 $stt=0;
	 $tooltipsData="";
        while($rows_moi = mysql_fetch_array($san_pham))
        {
                if($rows_moi['idLoai']==45||$rows_moi['idLoai']==43||$rows_moi['idLoai']==46)
                {
                     
                    ?>
                <td style="width: 29%"><?php echo $rows_moi['TenSP'];?><br/>
                <a href='Chitietsanpham.php?page=chitiet/../dtdd&idSP=<?php echo $rows_moi['idSP'];?>' data-tooltip="sticky<?php echo $rows_moi['idSP']?>">
                <img src="upload/sanpham/hinhchinh/<?php echo $rows_moi['UrlHinh']?>" width="100" height="100" align="center"/>
                <?php
                    if($rows_moi['New']==0)
                    echo'<img src="img/new.gif" width="29" height="19" align="top">';
                ?>
                   <span type="text"><?php echo number_format($rows_moi['Gia'],2)?></span>VNĐ<br/>
                   <?php  $stt++;?>
                   <?php
                        if($stt%3==0)
                           echo"</tr><tr>";
                ?>
                 
				<?php
					$tooltipsData .= '
						<div id="sticky'.$rows_moi["idSP"].'" class="atip" style="width: 200px">  
										'.$rows_moi["TenSP"].'<br/>
											<img src="upload/sanpham/hinhchinh/'.$rows_moi["UrlHinh"].'"><br/>';
					if($rows_moi["New"]==0)
						$tooltipsData .= '<img src="img/new.gif" width="29" height="19" align="top"><br/>';
					$tooltipsData .= '<span type="text">'.number_format($rows_moi["Gia"],2).'</span>VNĐ<br/></div>';
					
				}
				else echo "";
				
				?>				 
      <?php }?>
 </table>
 
 
<!-- HTML tooltip -->
<div id="mystickytooltip" class="stickytooltip">
			<div style="padding: 5px">
				<?=$tooltipsData;?>
			</div>
		</div>


</html> 
                   

   
